home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 65.zip / BS1 part 65 / Math Visin v2.1 disk 2.adf / Arexx.CLI / tutorialexample.rexx < prev    next >
OS/2 REXX Batch file  |  1992-02-14  |  2KB  |  67 lines

  1. /* TutorialExample, a sample ARexx program for MathVision.
  2.  
  3.   This is a trivial program to draw a series of plots on the screen.
  4. Feel free to put different numbers in the user settings sections, and
  5. also note the Put Parameter Here section.
  6.  
  7.   The idea of this program is that it draws a series of plots, using
  8. a different parameter each time.  The variable Pictures is the number of
  9. steps to do it in, and ParameterStart and ParameterEnd are the starting
  10. and ending values of the parameter.  Be sure to use the parameter in 
  11. the Use Parameter Here section.
  12. */
  13.  
  14. /*============================== User Settings =============================*/
  15.  
  16. Pictures = 5            /* Number of pictures to plot */
  17.  
  18. ParameterStart = .7        /* start and end values for the parameter */
  19. ParameterEnd   = 1
  20. /*==========================================================================*/
  21.    
  22. ADDRESS "MathVision"
  23. OPTIONS RESULTS            /* We need answers */
  24. OPTIONS FAILAT 1        /* die on all errors */
  25. SIGNAL ON ERROR            /* go to error handler */
  26. NUMERIC DIGITS 15        /* for small things */
  27.  
  28. StopSign "F"
  29.  
  30. /*----------- set up for this particular plot ----------*/
  31. /* normally we just use whatever MathVision happens to have */
  32. Overplot T
  33. EraseScreen
  34. PlotScreenToFront
  35. SimpleSampleDelta 2
  36. xmin 0
  37. xmax 12.56 
  38. ymin "-1"
  39. ymax 1
  40. /*----------------------*/
  41.  
  42. DO PictureNumber = 0 TO Pictures-1    /* for each picture...*/
  43.  
  44.   mult = (PictureNumber) / (Pictures-1)        /* 0..1 */
  45.   parameter = ParameterStart + mult*(ParameterEnd - ParameterStart)
  46.  
  47.   /*======================= USE PARAMETER HERE ========================== */
  48.  
  49.   f0 "Sin(x)*"parameter    
  50.   PlotSimple             /* do the appropriate plot */
  51.  
  52.   /*===================================================================== */
  53.  
  54.   Get StopSign            /* did user hit Ctrl-Esc ? */
  55.   IF RESULT = "T" THEN BREAK
  56. END /* do */
  57. WorkbenchScreenToFront
  58.  
  59. EXIT
  60.   
  61. ERROR:            /* Error Diagnostic for return codes */
  62.  
  63.   Get Diagnosis RC
  64.   SAY RESULT" on line "SIGL
  65.   EXIT
  66.  
  67.